﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Emu8080.Compiler.Structures
{
    public enum Operators : byte
    {
        // no operands
        NOP = 0x00,
        HLT = 0x76,
        EI = 0xfb,
        DI = 0xf3,
        SPHL = 0xf9,
        XCHG = 0xeb,
        XTHL = 0xe3,
        DAA = 0x27,
        CMA = 0x2f,
        STC = 0x37,
        CMC = 0x3f,
        RLC = 0x07,
        RRC = 0x0f,
        RAL = 0x17,
        RAR = 0x1f,
        PCHL = 0xe9,
        RET = 0xc9,
        RNZ = 0xc0,
        RZ = 0xc8,
        RNC = 0xd0,
        RC = 0xd8,
        RPO = 0xe0,
        RPE = 0xe8,
        RP = 0xf0,
        RM = 0xf8,

        // im16     
        LDA = 0x3a,
        STA = 0x32,
        LHLD = 0x2a,
        SHLD = 0x22,
        JMP = 0xc3,
        JNZ = 0xc2,
        JZ = 0xca,
        JNC = 0xd2,
        JC = 0xda,
        JPO = 0xe2,
        JPE = 0xea,
        JP = 0xf2,
        JM = 0xfa,
        CALL = 0xcd,
        CNZ = 0xc4,
        CZ = 0xcc,
        CNC = 0xd4,
        CC = 0xdc,
        CPO = 0xe4,
        CPE = 0xec,
        CP = 0xf4,
        CM = 0xfc,

        // rp im16   
        LXI = 0x01,

        // im8      
        ADI = 0xc6,
        ACI = 0xce,
        SUI = 0xd6,
        SBI = 0xde,
        ANI = 0xe6,
        XRI = 0xee,
        ORI = 0xf6,
        CPI = 0xfe,
        IN = 0xdb,
        OUT = 0xd3,

        // reg im8   
        MVI = 0x06,

        // reg reg   
        MOV = 0x40,

        // reg      
        ADD = 0x80,
        ADC = 0x88,
        SUB = 0x90,
        SBB = 0x98,
        ANA = 0xa0,
        XRA = 0xa8,
        ORA = 0xb0,
        CMP = 0xb8,
        INR = 0x04,
        DCR = 0x05,

        // rp       
        LDAX = 0x0A,
        STAX = 0x02,
        DAD = 0x09,
        INX = 0x03,
        DCX = 0x0b,
        PUSH = 0xc5,
        POP = 0xc1,

        // rst
        RST = 0xC7
    }

}
